package com.zzyl.mapper;

import com.zzyl.entity.NursingProjectPlan;
import com.zzyl.vo.NursingProjectPlanVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NursingProjectPlanMapper {

    /**
     * 根据护理项目ID查询护理计划
     *
     * @param projectId 护理项目ID
     * @return {@code List<NursingProjectPlan> }
     * @author YiSheep
     */
    @Select("select * from nursing_project_plan where project_id = #{projectId}")
    List<NursingProjectPlan> getByProjectId(Long projectId);

    /**
     * 添加护理计划中的项目
     *
     * @param nursingProjectPlan 护理项目计划
     * @author YiSheep
     */
    void addNursingProjectPlan(NursingProjectPlan nursingProjectPlan);

    /**
     * 根据护理计划ID查询护理计划中的项目
     *
     * @param planId 护理计划ID
     * @return {@code List<NursingProjectPlanVo> }
     * @author YiSheep
     */
    List<NursingProjectPlanVo> getByPlanId(Long planId);

    /**
     * 按护理计划ID删除
     *
     * @param planId 护理计划ID
     * @author YiSheep
     */
    @Delete("delete from nursing_project_plan where plan_id = #{planId}")
    void deleteByPlanId(Long planId);
}
